home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCGUIA 117
/
PC Guia 117.iso
/
Software
/
Utils
/
Software6
/
Product8
/
feedview-0.9.7-fx.xpi
/
chrome
/
feedview.jar
/
content
/
rss.xml
< prev
next >
Wrap
Extensible Markup Language
|
2005-03-19
|
9KB
|
207 lines
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:date="http://www.jclark.com/xt/java/java.util.Date"
xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0"
xmlns:atom="http://purl.org/atom/ns#"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<xsl:param name="feedUrl"/>
<xsl:param name="feedDescription"/>
<xsl:param name="feedTitle"/>
<xsl:param name="article_length"/>
<xsl:param name="articleSize"/>
<xsl:param name="showDate"/>
<xsl:param name="showBar"/>
<xsl:param name="showImage"/>
<xsl:param name="showImage"/>
<xsl:param name="timerInterval"/>
<xsl:param name="externalCSS"/>
<xsl:output method="html" media-type="text/html"/>
<xsl:template match="/">
<html>
<head>
<link rel="alternate" type="application/rss+xml" title="Current Feed" href=""/>
<title>
<xsl:value-of select="$feedTitle"/>
</title>
<link rel="stylesheet" href="chrome://feedview/content/default.css"/>
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:value-of select="$externalCSS"/>
</xsl:attribute>
</link>
<script src="chrome://feedview/content/feedview.js"></script>
</head>
<body>
<!-- Menu box -->
<div id="menubox">
<xsl:value-of select="$article_length"/>
<br/>
<table>
<tr id="sizeSwitcher">
<td>
<a onclick="javascript:resize(100);">
<div style="height: 10px;"/>
</a>
</td>
<td>
<a onclick="javascript:resize(300);">
<div style="margin-left: 8px; margin-right: 8px; height: 15px; "/>
</a>
</td>
<td>
<a onclick="javascript:resize(900);">
<div style="height: 20px; "/>
</a>
</td>
</tr>
</table>
<xul:slider id="sizeslider" style="width:110px; " flex="1" pageincrement="10" maxpos="100" onmousemove="resize(this.getAttribute('curpos'))" onclick="resize(this.getAttribute('curpos'))" onmouseup="resize(this.getAttribute('curpos'))">
<xsl:attribute name="curpos">
<xsl:value-of select="$articleSize"/>
</xsl:attribute>
<xul:thumb/>
</xul:slider>
<br/>
<br/>
<span id="number">
<xsl:value-of select="$feedDescription"/>
</span>
<br/>
<br/>
<a id="switchdate" onclick="javascript:if(this.getAttribute('show')==0)this.setAttribute('show',1);else this.setAttribute('show',0); switchdate();" >
<xsl:attribute name="show">
<xsl:value-of select="$showDate"/>
</xsl:attribute>
</a>
<br/>
<br/>
<span id="timerspan">Refresh in <span id="timevalue">
<xsl:value-of select="$timerInterval"/>
</span> seconds</span>
</div>
<options id="options" style="display:none">
<xsl:attribute name="showbar">
<xsl:value-of select="$showBar"/>
</xsl:attribute>
<xsl:attribute name="showimage">
<xsl:value-of select="$showImage"/>
</xsl:attribute>
<xsl:attribute name="timerinterval">
<xsl:value-of select="$timerInterval"/>
</xsl:attribute>
</options>
<xsl:apply-templates/>
<!-- Dynamic stuff -->
<script><![CDATA[
if(document.getElementById("options").getAttribute("showbar") != "true")
document.getElementById("menubox").style.display = "none";
if(document.getElementById("options").getAttribute("showimage") != "true")
showImage = false; else showImage = true;
setDate(); resize(document.getElementById("sizeslider").getAttribute("curpos"), showImage); setFeed(); switchdate();
var interval = document.getElementById("options").getAttribute("timerinterval");
function refresh(){
interval -= 1;
if(interval <= 0)
window.location.href = window.location.href;
else
document.getElementById("timevalue").textContent = interval;
setTimeout("refresh()",1000);
}
if(interval > 0)
setTimeout("refresh()",1000);
else
document.getElementById("timerspan").style.display = "none";
]]>
</script>
</body>
</html>
</xsl:template>
<!-- RSS RDF Support-->
<xsl:template name="a-element">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:apply-templates select="*[local-name()='link']"/>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']"/>
</xsl:element>
</xsl:template>
<xsl:template match="*[local-name()='channel']">
<h1>
<xsl:call-template name="a-element"/>
</h1>
<!-- Following line for RSS .091 -->
<div id="articles">
<xsl:apply-templates select="*[local-name()='item']"/>
</div>
</xsl:template>
<xsl:template match="*[local-name()='image']"></xsl:template>
<xsl:template match="*[local-name()='textinput']"></xsl:template>
<xsl:template match="*[local-name()='item']">
<div class="post">
<xsl:attribute name="description">
<xsl:value-of select="*[local-name()='description']" />
</xsl:attribute>
<xsl:if test="dc:date">
<xsl:attribute name="date">
<xsl:value-of select="dc:date" />
</xsl:attribute>
</xsl:if>
<xsl:if test="*[local-name()='pubDate']">
<xsl:attribute name="date">
<xsl:value-of select="*[local-name()='pubDate']" />
</xsl:attribute>
</xsl:if>
<xsl:call-template name="a-element"/>
<span class="date"></span>
<p></p>
</div>
</xsl:template>
<!-- ATOM SUPPORT-->
<xsl:template match="atom:feed">
<h1>
<a href="{atom:link[substring(@rel, 1, 8)!='service.']/@href}">
<xsl:value-of select="atom:title"/>
</a>
</h1>
<div id="articles">
<xsl:apply-templates select="atom:entry"/>
</div>
</xsl:template>
<xsl:template match="atom:entry">
<div class="post">
<xsl:if test="atom:issued">
<xsl:attribute name="date">
<xsl:value-of select="atom:issued"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="description">
<xsl:choose>
<xsl:when test="atom:content">
<xsl:value-of select="atom:content"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="atom:summary"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<a href="{atom:link[substring(@rel, 1, 8)!='service.']/@href}">
<xsl:value-of select="atom:title"/>
</a>
<span class="date"/>
<p/>
</div>
</xsl:template>
</xsl:stylesheet>